// v-color

import type { Directive, DirectiveBinding } from "vue";

// v-my-color="'pink'"
export const myColor: Directive = {
  // DOM 挂载时触发
  mounted(el: HTMLElement, binding: DirectiveBinding<string>){
    console.log(el, binding);
    el.style.color = binding.value
  },
  // DOM 更新时触发
  updated(el: HTMLElement, binding: DirectiveBinding<string>){
    el.style.color = binding.value
  }
}